<template>
  <div class="not-found">
    <el-row justify="center">
      <el-col class="img-container">
        <img src="@/assets/img/views/404/404.svg" alt="网络不好" />
      </el-col>
      <el-col class="button-group">
        <el-button @click="backOne" style="color: #00a733">
          <span><i class="el-icon-back"></i></span>
          返回上一页
        </el-button>
        <el-button @click="backIndex">
          <span><i class="el-icon-cloudy"></i></span>
          返回首页
        </el-button>
      </el-col>
    </el-row>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import { useRouter } from 'vue-router'

export default defineComponent({
  setup() {
    const router = useRouter()
    const backOne = () => {
      router.back()
    }
    const backIndex = () => {
      router.push({
        path: '/main'
      })
    }

    return {
      backOne,
      backIndex
    }
  }
})
</script>

<style scoped lang="less">
.not-found {
  .img-container {
    text-align: center;
  }
  .button-group {
    text-align: center;
  }
}
</style>
